<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 引入标签库 -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
  
<html>
<head>
	<title>商品新增</title>
	<!-- 包含公共资源 -->
	<%@ include file="/commons/meta.jsp" %>
	<%@ include file="/commons/meta-easyui.jsp" %>
	<script>
		// extend the 'equals' rule
		$.extend($.fn.validatebox.defaults.rules, {
		    equals: {
		        validator: function(value,param){
		            return value == $(param[0]).val();
		        },
		        message: '两次密码不相同'
		    }
		});
		function submitForm() {
			//easyui的form上调用validate方法
			var valid = $('#createForm').form('validate');
			//如果都验证成功,提交表单
			if(valid){
				//检测用户名
				$('#createForm').submit();
			}
		}
	</script>
</head>
<body>
	<div style="margin: 10px 5px; text-align: left">
		<a class="easyui-linkbutton" data-options="plain:true" onclick="submitForm();">提交</a> 
		<a class="easyui-linkbutton" data-options="plain:true" onclick="window.location='${ctx}/Goods/list.do'">返回列表</a> 
		<a class="easyui-linkbutton" data-options="plain:true" onclick="history.back();">后退</a>
	</div>
	<form action="${ctx}/Goods/save.do" method="post" id="createForm" enctype="multipart/form-data">
		
		<table class="formTable">
			<%@ include file="form_include.jsp" %>	
		</table>
	</form>
</body>
</html>